<?php

/*  lamp-shade_0.1
 *  License: GNU GPL v3
 *  File: ./modules/page/content.php
 *  Last Mod.:  02/11/11 by Werner
 *  Authors:    Werner Roets
 *              Frank Adrian
 *  Description:
 *  This class holds page content and all Content_item objects.
 */

require_once("./modules/layout/content_layout.php");
require_once("./modules/layout/default_homepage_layout.php");
require_once("./modules/standard/exceptions.php");

class Content
{
    public $Layout = null;//Holds a layout object
    public $Content_items = null;//holds content items
    
    public function __construct()
    {
    }
    
    public function SetLayout(Content_Layout_Layout $layout)
    {
	$this->Layout = $layout; 
    }
    
    public function Render()
    {
	print '
	<!-- Content -->
	<div id="content">';
	if($this->Layout == null)
	{
	    $this->Layout = new Default_homepage_layout();
	}
	if($this->Content_items != null)
	{
	    $this->Layout->Render($this->Content_items);
	}
	else
	{
	    $e = new ContentEmptyException();
	    print $e->Message();
	}
	print '
	</div>
	<!-- end Content -->';
    }
}


?>

